.map-mode-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    gap: 15px;
}

.header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

.controls {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

#toggle-sidebar {
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.map-type-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.map-type-selector label,
.map-mode-selector label,
.checkbox-label {
    margin-right: 8px;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.zoom-display {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    background-color: #f8f9fa;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    min-width: 60px;
    text-align: center;
}

#map-type,
#map-mode {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
}

#map-mode:hover {
    border-color: #aaa;
}

#map-mode:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

#mode-status {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

#current-mode {
    font-weight: bold;
    color: #0066cc;
}

#offline-mode {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 地图容器 */
.map-container {
    flex: 1;
    width: 100%;
    position: relative;
}

/* 模式说明（移至离线地图管理面板） */
.mode-description {
    font-size: 12px;
    color: #888;
    margin: 10px 0 0 0;
    line-height: 1.4;
}

/* 侧边栏样式 */
.sidebar {
    position: absolute;
    right: 20px;
    top: 80px;
    width: 320px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.panel h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.panel h4 {
    font-size: 16px;
    margin: 15px 0 10px;
    color: #34495e;
}

/* 按钮样式 */
.btn {
    padding: 10px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-bottom: 15px;
}

.btn-control {
    padding: 8px 16px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.btn-control:hover {
    background-color: #229954;
}

.btn:hover:not(:disabled) {
    background-color: #2980b9;
}

.btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.view-btn,
.delete-btn {
    padding: 6px 12px;
    margin-left: 8px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.view-btn {
    background-color: #27ae60;
    color: white;
}

.view-btn:hover {
    background-color: #229954;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background-color: #c0392b;
}

/* 缩放范围设置 */
.zoom-range {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.zoom-range label {
    font-size: 14px;
    color: #666;
}

#min-zoom,
#max-zoom {
    width: 60px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 下载状态 */
.offline-status {
    margin-bottom: 15px;
    display: none;
}

.progress-container {
    width: 100%;
    height: 6px;
    background-color: #ecf0f1;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background-color: #27ae60;
    width: 0%;
    transition: width 0.3s ease;
}

.status-text {
    font-size: 14px;
    color: #666;
}

/* 已保存地图列表 */
.saved-maps-list {
    list-style: none;
}

.saved-map-item {
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9;
    transition: all 0.2s ease;
}

.saved-map-item.active {
    background-color: #e8f4f8;
    border-color: #2196F3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.map-info {
    font-size: 14px;
    color: #555;
}

.map-info strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 5px;
}

.no-maps,
.error-message {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-style: italic;
}

.error-message {
    color: #e74c3c;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 15px;
    font-size: 16px;
    color: #34495e;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .sidebar {
        width: 280px;
        right: 10px;
        top: 100px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
    }
    
    .zoom-range {
        flex-direction: column;
        align-items: stretch;
    }
    
    .saved-map-item {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .view-btn,
    .delete-btn {
        margin-left: 0;
    }
}